<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class LayoutNoticeController extends Controller
{
    public static function getIndex()
    {
       	$data = DB::table('notice')->where('status','2')->get();
        //解析模板
        return view('Home.notice.notice',['notice'=>$data]);
    }

    public function getNotice($id)
    {
    	//根据id查询
    	$res = DB::table('notice')->where('id',$id)->first();
    	//所有可以公告
    	$data = DB::table('notice')->where('status','2')->get();
    	return view('Home.notice.homenotice',['notice'=>$data,'request'=>$res]);
    }
}
